package com.wtwd.campus.jdzc.dao;


import com.wtwd.campus.jdzc.entity.JdzcUser;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author mjy
 * @date 2022/02/14
 * @description
 */
@Mapper
public interface JdzcUserMapper {


    JdzcUser getUserInfoByPhone(@Param("phone") String phone);

    Integer addWxUser(JdzcUser jdzcUser);

    Integer updateWxUserLastLoginTime(@Param("userId") Integer userId, @Param("lastLoginTime") long lastLoginTime);

    /**
     * 获取用户绑定的学生列表
     *
     * @param userId
     * @return
     */
    @MapKey("student_id")
    List<Map<String,Object>> getUserStudentList(@Param("userId") Integer userId);

    JdzcUser getWxUserById(@Param("userId") Integer userId);

    List<Map<String, Object>> getOpenIdAndStuNameListByClassId(Integer classId);
}
